package com.yunji.cabinet.dao.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yunji.cabinet.dao.ITakeDeliveryInfoDao;
import com.yunji.cabinet.domain.TakeDeliveryInfoDO;
import com.yunji.cabinet.mapper.ITakeDeliveryInfoMapper;
import com.yunji.cabinet.params.TakeDeliverParam;
import com.yunji.common.base.BaseDaoImpl;
import com.yunji.common.utils.bean.BeanUtils;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class TakeDeliveryInfoDaoImpl extends BaseDaoImpl<ITakeDeliveryInfoMapper, TakeDeliveryInfoDO> implements ITakeDeliveryInfoDao {
    @Override
    public List<TakeDeliveryInfoDO> getPageList(TakeDeliverParam param) {
        return pageList(param,new LambdaQueryWrapper<TakeDeliveryInfoDO>()
                .eq(BeanUtils.isNotNull(param.getTakeId()),TakeDeliveryInfoDO::getTakeId,param.getTakeId())
                .eq(BeanUtils.isNotNull(param.getTakeCode()),TakeDeliveryInfoDO::getTakeCode,param.getTakeCode()));
    }
}
